/*
 * XML Type:  PollRequestType
 * Namespace: http://docs.oasis-open.org/wsrm/2004/06/ws-reliability-1.1.xsd
 * Java type: cgl.narada.wsinfra.schemas.wsr.PollRequestType
 *
 * Automatically generated - do not modify.
 */
package cgl.narada.wsinfra.schemas.wsr.impl;
/**
 * An XML PollRequestType(@http://docs.oasis-open.org/wsrm/2004/06/ws-reliability-1.1.xsd).
 *
 * This is a complex type.
 */
public class PollRequestTypeImpl extends cgl.narada.wsinfra.schemas.wsr.impl.HeaderBaseTypeImpl implements cgl.narada.wsinfra.schemas.wsr.PollRequestType
{
    
    public PollRequestTypeImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName REFTOMESSAGEIDS$0 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrm/2004/06/ws-reliability-1.1.xsd", "RefToMessageIds");
    private static final javax.xml.namespace.QName REPLYTO$2 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrm/2004/06/ws-reliability-1.1.xsd", "ReplyTo");
    
    
    /**
     * Gets array of all "RefToMessageIds" elements
     */
    public cgl.narada.wsinfra.schemas.wsr.RefToMessageIdsType[] getRefToMessageIdsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(REFTOMESSAGEIDS$0, targetList);
            cgl.narada.wsinfra.schemas.wsr.RefToMessageIdsType[] result = new cgl.narada.wsinfra.schemas.wsr.RefToMessageIdsType[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "RefToMessageIds" element
     */
    public cgl.narada.wsinfra.schemas.wsr.RefToMessageIdsType getRefToMessageIdsArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.wsr.RefToMessageIdsType target = null;
            target = (cgl.narada.wsinfra.schemas.wsr.RefToMessageIdsType)get_store().find_element_user(REFTOMESSAGEIDS$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "RefToMessageIds" element
     */
    public int sizeOfRefToMessageIdsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(REFTOMESSAGEIDS$0);
        }
    }
    
    /**
     * Sets array of all "RefToMessageIds" element
     */
    public void setRefToMessageIdsArray(cgl.narada.wsinfra.schemas.wsr.RefToMessageIdsType[] refToMessageIdsArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(refToMessageIdsArray, REFTOMESSAGEIDS$0);
        }
    }
    
    /**
     * Sets ith "RefToMessageIds" element
     */
    public void setRefToMessageIdsArray(int i, cgl.narada.wsinfra.schemas.wsr.RefToMessageIdsType refToMessageIds)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.wsr.RefToMessageIdsType target = null;
            target = (cgl.narada.wsinfra.schemas.wsr.RefToMessageIdsType)get_store().find_element_user(REFTOMESSAGEIDS$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(refToMessageIds);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "RefToMessageIds" element
     */
    public cgl.narada.wsinfra.schemas.wsr.RefToMessageIdsType insertNewRefToMessageIds(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.wsr.RefToMessageIdsType target = null;
            target = (cgl.narada.wsinfra.schemas.wsr.RefToMessageIdsType)get_store().insert_element_user(REFTOMESSAGEIDS$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "RefToMessageIds" element
     */
    public cgl.narada.wsinfra.schemas.wsr.RefToMessageIdsType addNewRefToMessageIds()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.wsr.RefToMessageIdsType target = null;
            target = (cgl.narada.wsinfra.schemas.wsr.RefToMessageIdsType)get_store().add_element_user(REFTOMESSAGEIDS$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "RefToMessageIds" element
     */
    public void removeRefToMessageIds(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(REFTOMESSAGEIDS$0, i);
        }
    }
    
    /**
     * Gets the "ReplyTo" element
     */
    public cgl.narada.wsinfra.schemas.reference.ServiceRefType getReplyTo()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.reference.ServiceRefType target = null;
            target = (cgl.narada.wsinfra.schemas.reference.ServiceRefType)get_store().find_element_user(REPLYTO$2, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "ReplyTo" element
     */
    public boolean isSetReplyTo()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(REPLYTO$2) != 0;
        }
    }
    
    /**
     * Sets the "ReplyTo" element
     */
    public void setReplyTo(cgl.narada.wsinfra.schemas.reference.ServiceRefType replyTo)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.reference.ServiceRefType target = null;
            target = (cgl.narada.wsinfra.schemas.reference.ServiceRefType)get_store().find_element_user(REPLYTO$2, 0);
            if (target == null)
            {
                target = (cgl.narada.wsinfra.schemas.reference.ServiceRefType)get_store().add_element_user(REPLYTO$2);
            }
            target.set(replyTo);
        }
    }
    
    /**
     * Appends and returns a new empty "ReplyTo" element
     */
    public cgl.narada.wsinfra.schemas.reference.ServiceRefType addNewReplyTo()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.reference.ServiceRefType target = null;
            target = (cgl.narada.wsinfra.schemas.reference.ServiceRefType)get_store().add_element_user(REPLYTO$2);
            return target;
        }
    }
    
    /**
     * Unsets the "ReplyTo" element
     */
    public void unsetReplyTo()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(REPLYTO$2, 0);
        }
    }
}
